//package xyz.erupt.flow.process.listener.impl.MonitorsImpl;
//
//import lombok.extern.slf4j.Slf4j;
//import lombok.var;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.ApplicationContext;
//import org.springframework.stereotype.Component;
//import xyz.erupt.flow.bean.entity.OaTask;
//import xyz.erupt.flow.process.listener.ExecutableNodeListener;
//import xyz.erupt.upms.service.EruptContextService;
//
///**
// * @author PP
// * @version 1.0
// * @project Erupt
// * @description 当流程离开该节点时监听(采用完成任务来监听)
// * @date 2024/9/2 14:36:34
// */
//@Slf4j
//@Component
//public class NodeEndMonitor implements ExecutableNodeListener<OaTask> {
//
//
//    @Autowired
//    ProcessInstanceService processInstanceService;
//    @Autowired
//    ProcessNodeEngine processNodeEngine;
//    @Autowired
//    ApplicationContext applicationContext;
//    @Autowired
//    EruptContextService eruptContextService;
//    @Override
//    public void execute(OaTask executableNode) {
//        log.info(executableNode.getTaskName()+":离开节点");
//        var instance =processInstanceService.getById(executableNode.getProcessInstId());
//        var node = instance!=null?instance.getProcessNode():null;//根节点
//        var currentNode = processNodeEngine.getNodeById(node,executableNode.getActivityKey());//获取当前节点
//        if (currentNode!=null){
//            var endMonitors = currentNode.getProps().getMonitors()!= null?currentNode.getProps().getMonitors().getEndMonitors():null;
//            if(endMonitors!=null){
//                for (var end:endMonitors) {
//                    Utils.DoMonitor(end,instance,applicationContext,eruptContextService);//执行流程监听代码
//                }
//            }
//        }
//    }
//}
